/** \file InstrumentMultiphonique.h
    \author belot.nicolas
    Manage an multiphonic instrument like a guitar
*/

#ifndef INSTRUMENTMULTIPHONIQUE_H
#define INSTRUMENTMULTIPHONIQUE_H 1

#include <queue>
#include <deque>
#include <map>
#include "Instrument.h"

namespace libtrckr {

class InstrumentMultiphonique : public Instrument {
public :
	/** \class libtrckr::InstrumentMultiphonique
	\brief simulate Instrument that can play n sample at a time.
	*/
	//Constructor
	//should be ...Instrument is an interface.
	InstrumentMultiphonique();
	InstrumentMultiphonique( string );//,name
	InstrumentMultiphonique( const InstrumentMultiphonique&);
	~InstrumentMultiphonique();

	//Accessor
	//Information
	string getName() const ;
	DynArray<string> getTuning() const;//Huh! vector :s
	DynArray<string> getAttacks() const;

	//Creation 
	void setName( string );
	void setTuning( DynArray<string> );
	void setNote( string, string,float,short,short,short);// ça devrais plutot prendre un string filename.
	void setAttack(string**);
	void setAttack(DynArray<string>);

	//Function working with the rest of the libs.
	 Buffer play( uint );//play xsample.
	 Buffer& play( Buffer & );//play xsample.
	 void addNote(string, Duration::note_duration_t,bool, uint,short,short,DynArray<PlayingEffect*>*) ;
	 void addNote(Note, uint,short,short,DynArray<PlayingEffect*>*) ;
	bool end() const;
	void letRing(bool);
private:
	string _name;
	DynArray<string> _tune; 
	uint8_t nb_string;
	DynArray<queue<INote>*> _partitions;
	DynArray<map<string, INote>*> _samples;
	DynArray<string> attack;
	uint8_t nb_attack;
	DynArray<Sample*> current;
	DynArray<uint> elapsed;
	DynArray<uint> duration;
	DynArray<double> mvolume;	
	DynArray<double> ratio;
	DynArray<DynArray<PlayingEffect*>* > effects;
	bool ring;
	
};

}

#endif

